﻿@model IEnumerable<FCNS.ERP.Models.ErpVip>

@{
    ViewBag.Title = "会员类型";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<h2>@ViewBag.Title</h2>
<p>
    <a class="newObjA" href="/Vip/VipNew">新增</a>
</p>
<table class="table">
    <tr> 
        <th>
            @Html.DisplayNameFor(model => model.Name)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.VipFlag)
        </th>
        <th>
            消费次数/初始积分
        </th>
        <th>
            消费时段(月)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Discoun)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.BonusPerYuan)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Money)
        </th>
        <th></th>
    </tr>

    @foreach (var item in Model)
    {
        <tr> 
            <td>
                @Html.DisplayFor(modelItem => item.Name)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.VipFlag)
            </td>
            <td>
                @if (item.VipFlag == FCNS.ERP.Models.ErpVip.EnumVipFlag.消费类型)
                {
                    if (item.InitValue == 0)
                    {
                        @Html.Raw("不限");
                    }
                    else
                    {
                        @Html.DisplayFor(modelItem => item.InitValue)
                    }
                }
                else
                {
                    @Html.DisplayFor(modelItem => item.InitValue)
                }
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Month)
            </td>
            <td>
                @if (item.VipFlag == FCNS.ERP.Models.ErpVip.EnumVipFlag.消费类型)
                {
                    @Html.Raw("0");
                }
                else
                {
                    @Html.DisplayFor(modelItem => item.Discoun)
                }
            </td>
            <td>
                @if (item.VipFlag == FCNS.ERP.Models.ErpVip.EnumVipFlag.消费类型)
                {
                    @Html.Raw("0");
                }
                else
                {
                    @Html.DisplayFor(modelItem => item.BonusPerYuan)
                }
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Money)
            </td>
            <td>
                @Html.ActionLink("编辑", "VipEdit", new { id = item.Id }) |
                <a href="VipDelete/@item.Id" class="objDelete">删除</a>
            </td>
        </tr>
    }

</table>
